OpenRoads Designer CONNECT Edition SDK Help

Preview of widening file(*.wid table)

The below code shows previewing the .wid file used for curve widening. The default location for .wid files is "C:\ProgramData\Bentley\OpenRoads Designer CE 10.12\Configuration\Organization-Civil\_Civil Default Standards - Imperial\Widening".

//Required References
using System;
using System.Windows.Forms;
using System.Drawing;
using System.IO;

 public void WideningFilePreview()
        {  
            string fileName = "C:\\ProgramData\\Bentley\\OpenRoads Designer CE 10.12\\Configuration\\curve_widening_imperial_no_spirals.wid";

            //Read all lines from csv file into array of strings
            String[] lines = File.ReadAllLines(fileName);

            System.Windows.Forms.Form form = new Form();
            form.ClientSize = new System.Drawing.Size(1100, 600);
            TextBox textBox = new TextBox();
            textBox.Multiline = true;

            // Set location of the textbox
            textBox.Location = new Point(10, 10);
            textBox.Height = 500;
            textBox.Width = 1000;
            textBox.AutoSize = true;

            foreach (string line in lines)
            {
                textBox.AppendText(line);
                textBox.AppendText("\r\n");
            }

            form.Text = "Preview of file " + fileName;
            form.Controls.Add(textBox);
            form.Show();
        }